﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using XbdSoft.WPFVersion.Common;

namespace XbdSoft.WPFVersion.ViewModel
{
    public class DownloadStatusImageConverter:IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            var url = "/Images/downloadstop.png";
            try
            {
                var status = (DownloadStatus)value;
                switch (status)
                {
                    case DownloadStatus.Paused:
                        url = "/Images/paused.png";
                        break;
                    case DownloadStatus.Downloading:
                        url = "/Images/downloading.png";
                        break;

                }
            }
            catch { }
            return new Uri(url,UriKind.RelativeOrAbsolute);
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
